function translate(val, l) {
    if (!val) return null
    let item = dict.find(obj => val === obj['cn'] || val === obj['en'] || val === obj['jp'])
    if (!item) return val
    return item[l ? l : 'cn']
}

const dict = [
    {"cn": "当前音量", "en": "Current volume", "jp": "現在の音量"},
    {"cn": "弹幕载入失败", "en": "Danmu loading failed", "jp": "弾幕ロード失敗"},
    {"cn": "弹幕载入成功", "en": "Danmu loading succeeded", "jp": "弾幕ロード成功"},
    {"cn": "弹幕载入成功", "en": "Danmu loading succeeded", "jp": "弾幕ロード成功"},
    {"cn": "后退", "en": "Back", "jp": "戻る"},
    {"cn": "快进", "en": "Forward", "jp": "まっすぐに"},
    {"cn": "倍速播放", "en": "Multiply playback", "jp": "倍速再生"},
    {"cn": "对象被销毁或发生了未知的意外", "en": "The object was destroyed or an unknown accident occurred", "jp": "物体被破坏或发生未知事故"},
    {"cn": "视频载入失败", "en": "Video loading failed", "jp": "ビデオロードに失敗しました"},
    {"cn": "数据格式错误", "en": "Data in wrong format", "jp": "データフォーマットエラー"},
]

export default translate
